package com.book.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.book.common.annotation.group.InsertGroup;
import com.book.common.annotation.group.UpdateGroup;
import com.book.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @author Bigboss
 * @create 2024-10-19 20:24
 */
@ApiModel(description = "图书分类")
@TableName("book_category")
public class BookCategory extends BaseEntity {

    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @NotBlank(message = "请选择要修改的记录",groups = {UpdateGroup.class})
    private String id;

    /**
     * 分类名称
     */
    @ApiModelProperty("分类名称")
    @NotBlank(message = "请输入分类名称",groups = {InsertGroup.class,UpdateGroup.class})
    private String categoryName;

    /**
     * 排序
     */
    @ApiModelProperty("排序")
    private Integer categorySort;


    /** 删除标志（0代表存在 2代表删除） */
    @ApiModelProperty("删除标志（0代表存在 2代表删除）")
    @TableLogic
    private String delFlag;


    @TableField(exist = false)
    private List<Book> bookList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public Integer getCategorySort() {
        return categorySort;
    }

    public void setCategorySort(Integer categorySort) {
        this.categorySort = categorySort;
    }

    public List<Book> getBookList() {
        return bookList;
    }

    public void setBookList(List<Book> bookList) {
        this.bookList = bookList;
    }

    @Override
    public String toString() {
        return "BookCategory{" +
                "id='" + id + '\'' +
                ", categoryName='" + categoryName + '\'' +
                ", categorySort=" + categorySort +
                ", delFlag='" + delFlag + '\'' +
                '}';
    }
}
